/*
 * Copyright 2014 Cungmua, Inc.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *    http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package cungmua.vn.kiosk.model;

import java.util.ArrayList;
import java.util.List;

import android.os.Parcel;
import android.os.Parcelable;

/**
 * @author kelvin.nguyen
 * 
 */
public class DonHang implements Parcelable {
	private int OrderId;
	private String CustomerName;
	private String Phone;
	private String Address;
	private String BuildingName;
	private String Note;
	private int AddressType;
	private List<SKU> SKUs;
	private double TotalMoney;
	private String TimeCreated;
	private String [] HistoryLog;
	private int Status = 0;
	private int ShipExpress;
	private int status_trave = 10;
	private int IsVip=0;
	private int numberDelay=0;
	private int is_Synchonize=0;
	
	
	
	
	

	/**
 * 
 */
	public DonHang() {
		super();
		// TODO Auto-generated constructor stub
	}

	public DonHang(Parcel in) {
		readFromParcel(in);
	}

	/**
	 * @param orderId
	 * @param address
	 * @param buildingName
	 * @param customerName
	 * @param phone
	 * @param addressType
	 * @param note
	 * @param status
	 * @param sKUs
	 */
	public DonHang(int orderId, String address, String buildingName,
			String customerName, String phone, int addressType, String note,
			int Status, List<SKU> sKUs) {
		super();
		OrderId = orderId;
		Address = address;
		BuildingName = buildingName;
		CustomerName = customerName;
		Phone = phone;
		AddressType = addressType;
		Note = note;
		this.Status = Status;
		SKUs = sKUs;
	}

	/**
	 * @param orderId
	 * @param address
	 * @param buildingName
	 * @param customerName
	 * @param phone
	 * @param addressType
	 * @param note
	 * @param status
	 * @param sKUs
	 * @param totalMoney
	 * @param timeCreated
	 * @param historyLog
	 * @param shipExpress
	 */
	public DonHang(int orderId, String address, String buildingName,
			String customerName, String phone, int addressType, String note,
			int Status, List<SKU> sKUs, double totalMoney, String timeCreated,
			String [] historyLog, int shipExpress,int IsVip,int numberDelay,int is_Synchonize ) {
		super();
		OrderId = orderId;
		Address = address;
		BuildingName = buildingName;
		CustomerName = customerName;
		Phone = phone;
		AddressType = addressType;
		Note = note;
		this.Status = Status;
		SKUs = sKUs;
		TotalMoney = totalMoney;
		TimeCreated = timeCreated;
		HistoryLog = historyLog;
		ShipExpress = shipExpress;
		this.IsVip=IsVip;
		this.numberDelay=numberDelay;
		this.is_Synchonize=is_Synchonize;
	}

	/**
	 * @param orderId
	 * @param address
	 * @param buildingName
	 * @param customerName
	 * @param phone
	 * @param addressType
	 * @param note
	 * @param status
	 */
	public DonHang(int orderId, String address, String buildingName,
			String customerName, String phone, int addressType, String note,
			int Status) {
		super();
		OrderId = orderId;
		Address = address;
		BuildingName = buildingName;
		CustomerName = customerName;
		Phone = phone;
		AddressType = addressType;
		Note = note;
		this.Status = Status;
	}

	/**
	 * @return the orderId
	 */
	public int getOrderId() {
		return OrderId;
	}

	/**
	 * @param orderId
	 *            the orderId to set
	 */
	public void setOrderId(int orderId) {
		OrderId = orderId;
	}

	/**
	 * @return the address
	 */
	public String getAddress() {
		return Address;
	}

	/**
	 * @param address
	 *            the address to set
	 */
	public void setAddress(String address) {
		Address = address;
	}

	/**
	 * @return the buildingName
	 */
	public String getBuildingName() {
		return BuildingName;
	}

	/**
	 * @param buildingName
	 *            the buildingName to set
	 */
	public void setBuildingName(String buildingName) {
		BuildingName = buildingName;
	}

	/**
	 * @return the customerName
	 */
	public String getCustomerName() {
		return CustomerName;
	}

	/**
	 * @param customerName
	 *            the customerName to set
	 */
	public void setCustomerName(String customerName) {
		CustomerName = customerName;
	}

	/**
	 * @return the phone
	 */
	public String getPhone() {
		return Phone;
	}

	/**
	 * @param phone
	 *            the phone to set
	 */
	public void setPhone(String phone) {
		Phone = phone;
	}

	/**
	 * @return the addressType
	 */
	public int getAddressType() {
		return AddressType;
	}

	/**
	 * @param addressType
	 *            the addressType to set
	 */
	public void setAddressType(int addressType) {
		AddressType = addressType;
	}

	/**
	 * @return the note
	 */
	public String getNote() {
		return Note;
	}

	/**
	 * @param note
	 *            the note to set
	 */
	public void setNote(String note) {
		Note = note;
	}

	/**
	 * @return the status
	 */
	public int getStatus() {
		return Status;
	}

	/**
	 * @return the sKUs
	 */
	public List<SKU> getSKUs() {
		return SKUs;
	}

	/**
	 * @param sKUs
	 *            the sKUs to set
	 */
	public void setSKUs(List<SKU> sKUs) {
		SKUs = sKUs;
	}

	/**
	 * @param status
	 *            the status to set
	 */
	public void setStatus(int Status) {
		this.Status = Status;
	}

	/**
	 * @return the totalMoney
	 */
	public double getTotalMoney() {
		return TotalMoney;
	}

	/**
	 * @param totalMoney
	 *            the totalMoney to set
	 */
	public void setTotalMoney(double totalMoney) {
		TotalMoney = totalMoney;
	}

	/**
	 * @return the timeCreated
	 */
	public String getTimeCreated() {
		return TimeCreated;
	}

	/**
	 * @param timeCreated
	 *            the timeCreated to set
	 */
	public void setTimeCreated(String timeCreated) {
		TimeCreated = timeCreated;
	}

	/**
	 * @return the historyLog
	 */
	public String [] getHistoryLog() {
		return HistoryLog;
	}

	/**
	 * @param historyLog
	 *            the historyLog to set
	 */
	public void setHistoryLog(String [] historyLog) {
		HistoryLog = historyLog;
	}

	/**
	 * @return the shipExpress
	 */
	public int getShipExpress() {
		return ShipExpress;
	}

	/**
	 * @param shipExpress
	 *            the shipExpress to set
	 */
	public void setShipExpress(int shipExpress) {
		ShipExpress = shipExpress;
	}

	/**
	 * @return the status_trave
	 */
	public int getStatus_trave() {
		return status_trave;
	}

	/**
	 * @param status_trave
	 *            the status_trave to set
	 */
	public void setStatus_trave(int status_trave) {
		this.status_trave = status_trave;
	}
	
	

	/**
	 * @return the isVip
	 */
	public int getIsVip() {
		return IsVip;
	}
	

	/**
	 * @param isVip the isVip to set
	 */
	public void setIsVip(int isVip) {
		IsVip = isVip;
	}
	
	

	/**
	 * @return the numberDelay
	 */
	public int getNumberDelay() {
		return numberDelay;
	}

	/**
	 * @param numberDelay the numberDelay to set
	 */
	public void setNumberDelay(int numberDelay) {
		this.numberDelay = numberDelay;
	}
	

	
	/**
	 * @return the is_Synchonize
	 */
	public int getIs_Synchonize() {
		return is_Synchonize;
	}

	/**
	 * @param is_Synchonize the is_Synchonize to set
	 */
	public void setIs_Synchonize(int is_Synchonize) {
		this.is_Synchonize = is_Synchonize;
	}

	@Override
	public int describeContents() {
		// TODO Auto-generated method stub
		return 0;
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see android.os.Parcelable#writeToParcel(android.os.Parcel, int)
	 */
	@Override
	public void writeToParcel(Parcel dest, int flags) {
		dest.writeInt(OrderId);
		dest.writeString(Address);
		dest.writeString(BuildingName);
		dest.writeString(CustomerName);
		dest.writeString(Phone);
		dest.writeInt(AddressType);
		dest.writeString(Note);
		dest.writeInt(Status);
		dest.writeInt(status_trave);
		dest.writeList(SKUs);
		dest.writeDouble(TotalMoney);
		dest.writeString(TimeCreated);
		dest.writeInt(ShipExpress);
		dest.writeInt(IsVip);
		dest.writeInt(numberDelay);
		dest.writeInt(is_Synchonize);

	}

	/** The Constant CREATOR. */
	public static final Parcelable.Creator CREATOR = new Parcelable.Creator() {
		public DonHang createFromParcel(Parcel in) {
			return new DonHang(in);
		}

		public DonHang[] newArray(int size) {
			return new DonHang[size];
		}
	};

	/**
	 * Read from parcel.
	 * 
	 * @param in
	 *            the in
	 */
	private void readFromParcel(Parcel in) {
		OrderId = in.readInt();
		Address = in.readString();
		BuildingName = in.readString();
		CustomerName = in.readString();
		Phone = in.readString();
		AddressType = in.readInt();
		Note = in.readString();
		Status = in.readInt();
		status_trave = in.readInt();
		SKUs = new ArrayList<SKU>();
		in.readList(SKUs, DonHang.class.getClassLoader());
		TotalMoney=in.readDouble();
		TimeCreated=in.readString();
		ShipExpress=in.readInt();
		IsVip=in.readInt();
		numberDelay=in.readInt();
		is_Synchonize=in.readInt();

	}

}
